/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.uva.streambuilder;

import javax.swing.border.*;
import java.awt.Graphics;
import java.awt.Insets;
import java.awt.Color;
import java.awt.Component;
import java.awt.GradientPaint;
import java.awt.Graphics2D;

/**
 *
 * @author rfdickerson
 */
public class ShadowBorder extends AbstractBorder {
    protected Color lineColor;
    private GradientPaint gradient =
    new GradientPaint(0, 0, Color.red, 175, 175, Color.yellow,
                      true); // true means to repeat pattern


    public ShadowBorder(Color color) {
        lineColor = color;
    }

    public void paintBorder(Component c, 
       Graphics g, int x, int y, int width, 
       int height) {
        Graphics2D g2 = (Graphics2D) g;
        //g2.setPaint(gradient);
          //g2.fillRect(x+5,y+5, width, height);
          
          g2.setColor(lineColor);
          g2.drawRect(x, y, width-1, height-1);
          g2.drawRect(x+2, y+2, 
             width-5, height-5);
          
          
          
    }

    public Insets getBorderInsets
     (Component c) {
        return new Insets(3,3,3,3);
    }

    public boolean isBorderOpaque() { 
        return false; 
    }

}
